<#compress>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>日志列表</title>
<#include "/admin/include/bootstrap.ftl">
<script src="/www/admin/js/article.js${version}"></script>
</head>
<body>
<#include "/admin/include/dashboard-start.ftl">
	<div class="module-toolbar g-clearfix" style="margin-bottom: 10px;">
			<form class="form-inline" method="post" action="article_list.do"  id="sform">
				  <div class="form-group">
				    <label for="keyword_txt">关键字</label>
				    <input type="text" value="${title!}" name="title" class="form-control" id="keyword_txt" placeholder="全文检索">
				  </div>
				  <div class="form-group">
				    <label>类型</label>
				    <select class="form-control" name="category" id="category">
				    		<option value=""></option>
							  <@Category website_id="${AdminWebSite.id}">
								  <#list category_lis as category>
									<option value="${category.categoryName}" pk="${category.id}"
									<#if categoryName==category.categoryName>
											selected="selected"
										</#if>
									>${category.categoryName}</option>
								</#list>
							</@Category> 
					</select>
				  </div>
				  <div class="btn-group">
				  	 <button type="submit" class="sbtn sbtn-purple2" data-toggle="tooltip" title="根据您输入的关键字进行查询" data-placement="bottom">
				  	 <span class="glyphicon glyphicon-search"></span>&nbsp;查询</button>
					  <button type="button" class="sbtn sbtn-yellow" onclick="article.updateCategory(data);" ><span class="glyphicon glyphicon-th-large"></span>&nbsp;分类</button>
					  <!--<button type="button" class="btn btn-default" onclick="setcover();" data-toggle="tooltip" title="设置文章封面图" data-placement="bottom"><span class="glyphicon glyphicon-picture"></span>&nbsp;封面</button>-->
					  <!--update_articletype.do-->
					  <button type="button" class="sbtn sbtn-red" onclick="article.delArticle('');" data-toggle="tooltip" title="删除您选中的文章" data-placement="bottom">
					  <span class="glyphicon glyphicon-remove"></span>&nbsp;删除</button>
				  </div>
			</form>
	</div>
	
		<table class="table table-striped table-hover table-bordered">
			<thead>
			<tr>
				<th><input type="checkbox" id="ar_chk_op" onclick="allchk(this);" ></th>
				<th>标题</th>
				<th>文章类型</th>
				<th>阅读次数</th>
				<th>上一修改</th>
				<th>标签(<strong style="color: red;">单击可删除</strong>)</th>
				<th>操作</th>
			</tr>
			</thead>
		<@Article page="${page!}" category="${categoryName!}" fulltext="${title!}"  website_id="${AdminWebSite.id}"  limit="${limit!13}" model="back">
		   		<#list article_lis as ar> 
		    		<tr onclick="rowclick(this);">
		    			<td><input type="checkbox" name="ar_chk" value="${ar.id}"> </td>
						<td>
						<#if (ar.articleCover?length > 0)><span class="glyphicon glyphicon-picture" title="有设置封面"></span></#if>
						<#if ar.articlePrivate><span class="glyphicon glyphicon-eye-close" title="私有博客"></span></#if>  
						<#if ar.articlePassword!=""><span class="glyphicon glyphicon-lock" title="密码查看"></span></#if>
						<#if !ar.articleAllowcomments><span class="glyphicon glyphicon-comment" title="禁止评论"></span></#if>
						<a href="${admin_blogprefix}/admin/edit_article.do?id=${ar.id}">${ar.articleTitle}</a></td>
						<td>${ar.category.categoryName}</td>
						<td>${ar.articleViewcount}</td>
						<td>${ar.articleUpdatetime}</td>
						<td>
							<#list ar.lables as lable><span class="label label-default" onclick="article.dellable('${lable.id}');">${lable.lableName}</span><#if lable_has_next> </#if></#list>
						</td>
						<td>
							<#if (ar.articleSort>0)>
								<button class="sbtn sbtn-yellow" onclick="article.canclefixedTop('${ar.id}');"  data-toggle="tooltip" title="取消置顶"><span class="glyphicon glyphicon-repeat"></span></button>
								<#else>
									<button class="sbtn sbtn-yellow" onclick="article.fixedTop('${ar.id}');"  data-toggle="tooltip" title="预览"><span class="glyphicon glyphicon-pushpin"></span> </button>
							</#if>
							<button class="sbtn sbtn-purple" onclick="article.crawImg('${ar.id}');"  data-toggle="tooltip" title="抓取外部图片保存到我的文件夹里"><span class="glyphicon glyphicon-paperclip"></span> </button>
							<button class="sbtn sbtn-green" onclick="window.open('http://${host}/${AdminWebSite.websiteName}/entry/${ar.id}.html');"  data-toggle="tooltip" title="预览"><span class="glyphicon glyphicon-search"></span> </button>
							<button class="sbtn sbtn-red" onclick="article.delArticle('${ar.id}');"  data-toggle="tooltip" title="删除"><span class="glyphicon glyphicon-remove"></span></button>
						</td>
					</tr>
		    	</#list>
    	</@Article>
		</table>
    <#assign url="${admin_blogprefix}/admin/article_list.do?category=${categoryName!}&title=${title!}&">
    <#include "/admin/include/page.ftl">
	<#include "/admin/include/dashboard-end.ftl">

</body>
<script type="text/javascript">
blogControlPanel.activePanelByText("文章管理");
$(function () { $("[data-toggle='tooltip']").tooltip();  });
var str="({";
var size=$('#category option').length;
$('#category option').each(function(i){
	var txt=$(this).text();
	var pk=$(this).attr("pk");
	if(txt!=""){
		str+="'"+pk+"':'"+txt+"'";
		if(i<size-1)str+=",";
	}
});
str+="})";
var data=eval(str);
</script>
</html>
</#compress>